<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="utf-8">
        <meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">	
        <meta name="apple-mobile-web-app-capable" content="yes">	
        <meta name="format-detection" content="telephone=no">
        <title>苏轨院-OA办公系统-<?php echo ($title); ?></title>
        <meta name="descption" content="<?php echo ($web["descption"]); ?>" />
        <meta name="keywords" content="<?php echo ($web["keywords"]); ?> " />
    <link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />

<link rel="stylesheet" type="text/css" href="/Public/Admin/common/layui/css/layui.css" media="all"/>
<link rel="stylesheet" type="text/css" href="/Public/Admin/common/bootstrap/css/bootstrap.css" media="all"/>
<link rel="stylesheet" type="text/css" href="/Public/Admin/common/global.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/adminstyle.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css" />

<script type="text/javascript" src="/Public/Admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/Public/Admin/common/layui/layui.js"></script>
<script type="text/javascript" src="/Public/Admin/js/larry.js"></script>
<script type="text/javascript" src="/Public/Admin/js/index.js"></script>
<script type="text/javascript" src="/Public/static/layer/layer.js" ></script>

<!--日历插件-->
<!--<link rel="stylesheet" type="text/css" href="/Public/static/fullcalendar/css/fullcalendar.css">
<link rel="stylesheet" type="text/css" href="/Public/static/fullcalendar/css/jquery-ui.css">
<script src='/Public/static/fullcalendar/js/fullcalendar.min.js'></script>  -->
<link rel="stylesheet" type="text/css" href="/Public/static/datetimepicker-master/jquery.datetimepicker.css">
<script type="text/javascript" src="/Public/static/datetimepicker-master/jquery.datetimepicker.js" ></script>

<!--自定义 css-->
<link rel="stylesheet" type="text/css" href="/Public/Admin/css/page.css">

<!--自定义 js-->
<!--<script type="text/javascript" src="/Public/static/js/formcheck.js" ></script>-->  
<script type="text/javascript" src="/Public/Admin/js/init.js" ></script>







    
    <link rel="stylesheet" href="/Public/Admin/css/personal.css"/>
    <link href="/Public/Admin/css/new_plan.css" rel="stylesheet" />
    <script src="/Public/static/layer/layer.js"></script>
    <!--文件上传-->
    <script type="text/javascript" src="/Public/Cropper/js/ajaxfileupload.js" ></script>
    <style>
        .textarea{height:50px;width:90%}
        .checkCont p{float:left;}
        .checkCont a{margin-left:10px;display: inline-block;}
        .fujian{margin:0;}
        .c-red{color:red}
        .pointer{cursor: pointer}
        .radioBox{padding:8px 0;}
        .radioBox>lable{margin-right:12px;}
        .radioBox>lable>i{position: relative;top: 2px}
        .planSaveBtn{border: 1px solid  #2299ee;color: #2299ee;background:#fff;}
        .planSaveBtn:hover{color: #2299ee;}
        .btnMargin .layui-btn{margin-right:10px;}
    </style>

</head>
<body class="mian-page">
    <div class="layui-layout layui-layout-admin" id="layui_layout">
        <!-- 顶部区域 -->
<div class="layui-header header header-demo">
    <div class="layui-main">
        <!-- logo区域 -->
        <div class="admin-logo-box">
            <a class="logo" href="javascript:;" title="logo">OA办公平台</a>
<!--            <div class="larry-side-menu">
                <i class="fa fa-bars" aria-hidden="true"></i>
            </div>-->
            <div class="larry-side-menu">
                <i class="" aria-hidden="true">
                    <img src="/Public/Admin/images/menuBar.png" />
                </i>
            </div>
            <div class="fullscreen">
                <img src="/Public/Admin/images/fullScreen.png" onclick="fullScreen()" />
            </div>
        </div>
        <!-- 右侧导航 -->
        <ul class="layui-nav larry-header-item">
            <li class="layui-nav-item">
                <a href="javascript:;" style="padding-right:25px;">
                    <img class="headImg" src="<?php if($userinfo[head] != null): echo ($userinfo["head"]); elseif($userinfo[sex] == 1): ?>/Public/Admin/images/man.png<?php else: ?>/Public/Admin/images/woman.png<?php endif; ?>">
                    <cite><?php echo ($userinfo["user_name"]); ?></cite>
                    <!--<span class="layui-nav-more" style="right:17px;"></span>-->
                </a>
<!--                <dl class="layui-nav-child">
                    <dd>
                        <a class="exit pointer" data-url="<?php echo U('Login/logout');?>">退出</a>
                    </dd>
                </dl>-->
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;" style="padding-right:25px;">
                    <i class="layui-icon"><img src="/Public/Admin/images/user.png" /></i>
                    <span class="layui-badge-dot"><?php echo ($attendCount); ?></span>
                    <span class="layui-nav-more" style="right:10px;"></span>
                </a>
                <div class="layui-nav-child stateBox" id="stateBox">
                    <div class="search">
                        <i class="layui-icon layui-icon-notice"><img src="/Public/Admin/images/searchiIcon.png" /></i>
                        <input type="text" placeholder="搜索人员" class="searchUser" value="" data-url="<?php echo U(searchUser);?>"/>
                    </div>
                    <ul>
                        <li class="item item-hide" state="hide">
                            <a>
                                <span>外出人员</span>
                                <label class="color1"><?php echo ($outCount); ?></label>
                                <em class="arrow"></em>
                            </a>
                            <dl>
                                <?php if(is_array($outList)): foreach($outList as $key=>$out): ?><dd>
                                        <img src="<?php echo ($out["head"]); ?>" />
                                        <span><?php echo (getChineseName($out["user_id"])); ?></span>
                                    </dd><?php endforeach; endif; ?>
                            </dl>
                        </li>
                        <li class="item item-hide" state="hide">
                            <a>
                                <span>出差人员</span>
                                <label class="color3"><?php echo ($evectionCount); ?></label>
                                <em class="arrow"></em>
                            </a>
                            <dl>
                                <?php if(is_array($evectionList)): foreach($evectionList as $key=>$evection): ?><dd>
                                        <img src="<?php echo ($evection["head"]); ?>" />
                                        <span><?php echo (getChineseName($evection["user_id"])); ?></span>
                                    </dd><?php endforeach; endif; ?>
                            </dl>
                        </li>
                        <li class="item item-hide" state="hide">
                            <a>
                                <span>请假人员</span>
                                <label class="color2"><?php echo ($leaveCount); ?></label>
                                <em class="arrow"></em>
                            </a>
                            <dl>
                                <?php if(is_array($leaveList)): foreach($leaveList as $key=>$leave): ?><dd>
                                        <img src="<?php echo ($leave["head"]); ?>" />
                                        <span><?php echo (getChineseName($leave["user_id"])); ?></span>
                                    </dd><?php endforeach; endif; ?>
                            </dl>
                        </li>
                    </ul>
                </div>
            </li>
        </ul>
    </div>
</div>
<script>
    $(initLogin());
    
    $("#stateBox>ul").height(window.innerHeight - 135);
    $(document).on("click", "#stateBox li>a", function () {
        var state = $(this).parents("li").attr("state");
        if (state == "hide") {
            $(this).parents("li").attr("state", "show");
            $(this).parents("li").addClass("item-show").removeClass("item-hide");
        } else if (state == "show") {
            $(this).parents("li").attr("state", "hide");
            $(this).parents("li").addClass("item-hide").removeClass("item-show");
        }
    })

    
    //全屏
    function fullScreen() {
        var el = document.documentElement;
        var rfs = el.requestFullScreen || el.webkitRequestFullScreen || 
        el.mozRequestFullScreen || el.msRequestFullScreen;
        if(typeof rfs != "undefined" && rfs) {
            rfs.call(el);
        } else if(typeof window.ActiveXObject != "undefined") {
    //for IE，这里其实就是模拟了按下键盘的F11，使浏览器全屏
            var wscript = new ActiveXObject("WScript.Shell");
            if(wscript != null) {
                    wscript.SendKeys("{F11}");
            }
        }
    }
</script>


        <!-- 左侧侧边导航开始 -->
<div class="layui-side layui-side-bg layui-larry-side" id="larry-side">
    <div class="layui-side-scroll" id="larry-nav-side" lay-filter="side">

        <!-- 左侧菜单 -->
        <ul class="layui-nav layui-nav-tree">
            <li class="layui-nav-item layui-this">
                <a href="<?php echo U('Index/index');?>">
                    <i class="iconfont homeIcon"></i>
                    <span>首页</span>
                </a>
            </li>
            <!-- 个人信息 -->
            <?php if(is_array($userMenus)): foreach($userMenus as $key=>$menu): ?><li class="layui-nav-item layui-child">
                    <a href="javascript:;" data-url="<?php echo ($menu["url"]); ?>" class="parentCate">
                        <i class="iconfont leftIcon<?php echo ($key+1); ?>" ></i>
                        <span><?php echo ($menu["name"]); ?></span>
                        <em class="layui-nav-more"></em>
                    </a>
                    <dl class="layui-nav-child">
                        <?php if(is_array($menu["child"])): foreach($menu["child"] as $key=>$child): ?><dd>
                                <a href="<?php if($child[param] != null): ?>/index.php/Home/<?php echo ($child["url"]); ?>&<?php echo ($child["param"]); else: ?>/index.php/Home/<?php echo ($child["url"]); endif; ?>" data-url="/index.php/Home/<?php echo ($child["url"]); ?>">
                                    <i class="iconfont" style="font-size:10px;">></i>
                                    <span style="font-size:13px;"><?php echo ($child["name"]); ?></span>
                                </a>
                            </dd><?php endforeach; endif; ?>
                    </dl>
                </li><?php endforeach; endif; ?>
        </ul>
    </div>
</div>
<!-- 左侧侧边导航结束 -->

        <!-- 右侧主体内容 -->
        <input type="hidden" id="loginUser" value="<?php echo ($user); ?>">
        <div class="layui-body" id="larry-body" style="bottom: 0;border-left: solid 2px #2299ee;">
            <div class="layui-tab layui-tab-card larry-tab-box" id="larry-tab" lay-filter="demo" lay-allowclose="true">
                <div class="go-left key-press pressKey" id="titleLeft" title="滚动至最右侧"><i class="larry-icon larry-weibiaoti6-copy"></i> </div>
                <ul class="layui-tab-title" style="display: none;">
                    <li class="layui-this" id="admin-home"><i class="iconfont icon-diannao1"></i><em>后台首页</em></li>
                </ul>
                <div class="go-right key-press pressKey" id="titleRight" title="滚动至最左侧"><i class="larry-icon larry-right"></i></div> 
                <ul class="layui-nav closeBox" style="display: none;">
                    <li class="layui-nav-item">
                        <a href="javascript:;"><i class="iconfont icon-caozuo"></i> 页面操作</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;" class="refresh refreshThis"><i class="layui-icon">&#x1002;</i> 刷新当前</a></dd>
                            <dd><a href="javascript:;" class="closePageOther"><i class="iconfont icon-prohibit"></i> 关闭其他</a></dd>
                            <dd><a href="javascript:;" class="closePageAll"><i class="iconfont icon-guanbi"></i> 关闭全部</a></dd>
                        </dl>
                    </li>
                </ul>
                <div class="layui-tab-content" style="min-height: 150px; ">
                    <div class="layui-tab-item layui-show" id="main">
                         
    <section class="layui-larry-box">
        <div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-normal newsAdd_btn" href="<?php echo U('Plan/index');?>">返回</a>
                    </div>
                    <input type="hidden" id="pType" value="<?php echo ($params["pType"]); ?>" />
                    <input type="hidden" id="deptName" value="<?php echo ($params["deptName"]); ?>" />
                    <input type="hidden" id="level" value="<?php echo ($params["level"]); ?>" />
                    <input type="hidden" id="smsFlag" value="<?php echo ($params["smsFlag"]); ?>" />
                    <input type="hidden" id="planName" value="<?php echo ($params["planName"]); ?>" />
                    <input type="hidden" id="start" value="<?php echo ($params["start"]); ?>" />
                    <input type="hidden" id="end" value="<?php echo ($params["end"]); ?>" />
                    <input type="hidden" id="p" value="<?php echo ($params["p"]); ?>" />
                </blockquote>
                <!-- 表单项 -->
                <form class="layui-form" action="">
                    <div class="layui-form-item">
                        <label class="layui-form-label">流程分类</label>
                        <div class="layui-input-block">
                            <select name="type" class="layui-input" lay-verify="required">
                                <?php if(is_array($planType)): foreach($planType as $key=>$type): ?><option value="<?php echo ($type["type_id"]); ?>" <?php echo ($info['type'] == $type['type_id'] ? 'selected' : ''); ?>><?php echo ($type["type_name"]); ?></option><?php endforeach; endif; ?>
                            </select>
                        </div>
                    </div>
                    <?php if($info['child_type'] != null): ?><div class="layui-form-item">
                            <label class="layui-form-label">标记</label>
                            <div class="layui-input-block">
                                <input type="text" autocomplete="off" class="layui-input" value="<?php echo (getChildType($info["child_type"])); ?>" readonly />
                            </div>
                        </div><?php endif; ?>
                    <div class="layui-form-item point">
                        <a class="open">
                            <label class="layui-form-label pointer" style="width:200px;text-align: right;padding-right:0">展开标记</label>
                            <img src="/Public/Admin/images/arrow-down.png" style="margin-top: 10px;">
                        </a>
                    </div>
                    <div class="childCate" style="display:none">
                        <div class="layui-form-item">
                            <label class="layui-form-label">选择标记</label>
                            <div class="layui-input-block">
                                <select name="child_type" class="layui-input">
                                    <option value="0">请选择</option>
                                    <?php if(is_array($planFlag)): foreach($planFlag as $key=>$pflag): ?><option value="<?php echo ($pflag["type_id"]); ?>"><?php echo ($pflag["type_name"]); ?></option><?php endforeach; endif; ?>s
                                </select>
                            </div>
                            <input type="hidden" class="getChildType" value="<?php echo U('getChildType');?>">
                            <input type='hidden' class="currType" value="<?php echo ((isset($info["child_type"]) && ($info["child_type"] !== ""))?($info["child_type"]):0); ?>">
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">增加标记</label>
                            <div class="layui-input-block">
                                <input type="text" name="add_type" autocomplete="off" class="layui-input" value="" />
                            </div>
                        </div>
                    </div>

                    <!--简洁模式-->
                    <div class="simple">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label"><span class="c-red">*</span>任务</label>
                            <div class="layui-input-block">
                                <textarea name="cont" placeholder="请输入内容" class="layui-textarea cont"><?php echo ($info["content"]); ?></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label"><span class="c-red">*</span>执行人</label>
                            <div class="layui-input-block layui-input checkCont value executor" style="width:90%">
                                <p class="textarea addUser addUser_5" data-id="5" data-key="executor">
                                    <span></span>
                                <?php if(is_array($info["execs"])): foreach($info["execs"] as $key=>$exec): ?><span class="one-name">
                                        <a><?php echo (getChineseName($exec)); ?></a>
                                        <img class="pointer delOperator" data-id="<?php echo ($exec); ?>" src="/Public/Index/img/close_red.png" alt="close" width="12">
                                        <input type="hidden" name="executor[]" value="<?php echo ($exec); ?>">
                                        <input type="hidden" name="user_names[]" value="<?php echo (getChineseName($exec)); ?>">
                                    </span><?php endforeach; endif; ?>
                                </p>
                                <!--<a class="arrow pointer addUser addUser_5" data-id="5" data-key="executor">&#xe638;</a>-->
                                <!--<a class="pointer delData">清空</a>-->
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span class="c-red">*</span>计划级别</label>
                            <div class="layui-input-block level radioBox">
                                <lable class="input_lable">
                                    <i class='input_style radio_bg <?php if($info[level] == 2): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="s_level" value="2" <?php echo ($info['level'] == 2 ? 'checked' : ''); ?>></i>
                                    部门级
                                </lable>
                                <lable class="input_lable">
                                    <i class='input_style radio_bg <?php if($info[level] == 1): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="s_level" value="1" <?php echo ($info['level'] == 1 ? 'checked' : ''); ?>></i>
                                    个人级
                                </lable>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">汇报周期</label>
                            <div class="layui-input-block">
                                <select name="s_cycle" class="layui-input">
                                    <option value="1">一周一报</option>
                                    <option value="2">一周二报</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">标的物</label>
                            <?php if($id != null): ?><div class="layui-input-block">
                                    <div class="fujian">
                                        <i class="iconfont">&#xe88a;</i> 
                                        <a href="#"><span class="fj">上传标的物(<?php echo (getAttchType($info["attach_type"])); ?>)</span>
                                            <span class="icon_add" id="upload">&#xe638;</span>
                                        </a>
                                        <div class="filename-cont">
                                            <?php if(is_array($uploads)): foreach($uploads as $key=>$upload): if($upload['is_pic'] == 0): ?><p style="border:0;line-height: 2em">
                                                        <a href="<?php echo ($upload["url"]); ?>" download="<?php echo ($upload["name"]); ?>"><?php echo ($upload["name"]); ?></a><img src="/Public/Index/img/close.png" style="width:15px" class="pointer delfile" data-fileurl="<?php echo ($upload["url"]); ?>">;
                                                    </p>
                                                    <?php else: ?>
                                                    <img class="showImg" src="<?php echo ($upload["url"]); ?>" width="100px" style="margin-right:10px" /><img src="/Public/Index/img/close.png" style="width:15px" class="pointer delfile" data-fileurl="<?php echo ($upload["url"]); ?>">;<?php endif; endforeach; endif; ?>
                                        </div>
                                    </div>
                                </div>
                                <?php else: ?>
                                <div class="layui-input-block attach_type radioBox">
                                    <lable class="input_lable">
                                        <i class='input_style radio_bg <?php if($info[attach_type] == 1): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="s_attach_type" value="1" <?php echo ($info['attach_type'] == 1 ? 'checked' : ''); ?>></i>
                                        word
                                    </lable>
                                    <lable class="input_lable">
                                        <i class='input_style radio_bg <?php if($info[attach_type] == 2): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="s_attach_type" value="2" <?php echo ($info['attach_type'] == 2 ? 'checked' : ''); ?>></i>
                                        excel
                                    </lable>
                                    <lable class="input_lable">
                                        <i class='input_style radio_bg <?php if($info[attach_type] == 3): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="s_attach_type" value="3" <?php echo ($info['attach_type'] == 3 ? 'checked' : ''); ?>></i>
                                        ppt
                                    </lable>
                                    <lable class="input_lable">
                                        <i class='input_style radio_bg <?php if($info[attach_type] == 4): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="s_attach_type" value="4" <?php echo ($info['attach_type'] == 4 ? 'checked' : ''); ?>></i>
                                        code
                                    </lable>
                                    <div style="clear:both"></div>
                                </div><?php endif; ?>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span class="c-red">*</span>紧急程度</label>
                            <div class="layui-input-block flag radioBox">
                                <lable class="input_lable" style="color:#235AA3">
                                    <i class='input_style radio_bg <?php if($info[flag] == 3): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="flag" value="3" <?php echo ($info['flag'] == 3 ? 'checked' : ''); ?>></i>
                                    一般
                                </lable>
                                <lable class="input_lable" style="color:#EA6900">
                                    <i class='input_style radio_bg <?php if($info[flag] == 2): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="flag" value="2" <?php echo ($info['flag'] == 2 ? 'checked' : ''); ?>></i>
                                    重要
                                </lable>
                                <lable class="input_lable" style="color:#E43127">
                                    <i class='input_style radio_bg <?php if($info[flag] == 1): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="flag" value="1" <?php echo ($info['flag'] == 1 ? 'checked' : ''); ?>></i>
                                    紧急
                                </lable>
                                <div style="clear:both"></div>
                            </div>
                        </div>
                    </div>

                    <!--详细模式-->
                    <div class="complex" style='display: none'>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span class="c-red">*</span>计划名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="name" required lay-verify="required" autocomplete="off" class="layui-input" value="<?php echo ($info["name"]); ?>" />
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">开放部门</label>
                            <div class="layui-input-block layui-input checkCont" style="width:90%">
                                <p class="textarea depart addDept">
                                    <span></span>
                                <?php if(is_array($info["depts"])): foreach($info["depts"] as $key=>$dept): ?><span>
                                        <a><?php echo (getDeptName($dept)); ?></a>
                                        <img class="pointer delOperator" data-id="<?php echo ($dept); ?>" src="/Public/Index/img/close_red.png" alt="close" width="12">
                                        <input type="hidden" name="dept_ids[]" value="<?php echo ($dept); ?>">
                                        <input type="hidden" name="dept_names[]" value="<?php echo (getDeptName($dept)); ?>">
                                    </span><?php endforeach; endif; ?>
                                </p>
                                <!--<a class="arrow pointer addDept">&#xe638;</a>-->
                                <!--<a class="pointer delData">清空</a>-->
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">开放人员</label>
                            <div class="layui-input-block layui-input checkCont value" style="width:90%">
                                <p class="textarea addUser addUser_1" data-id="1" data-key="to_person_id">
                                    <span></span>
                                <?php if(is_array($info["persons"])): foreach($info["persons"] as $key=>$person): ?><span class="one-name">
                                        <a><?php echo (getChineseName($person)); ?></a>
                                        <img class="pointer delOperator" data-id="<?php echo ($person); ?>" src="/Public/Index/img/close_red.png" alt="close" width="12">
                                        <input type="hidden" name="to_person_id[]" value="<?php echo ($person); ?>">
                                        <input type="hidden" name="user_names[]" value="<?php echo (getChineseName($person)); ?>">
                                    </span><?php endforeach; endif; ?>
                                </p>
                                <!--<a class="arrow pointer addUser addUser_1" data-id="1" data-key="to_person_id">&#xe638;</a>-->
                                <!--<a class="pointer delData">清空</a>-->
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">参与人</label>
                            <div class="layui-input-block layui-input checkCont value" style="width:90%">
                                <p class="textarea addUser addUser_2" data-id="2" data-key="participator">
                                    <span></span>
                                <?php if(is_array($info["parts"])): foreach($info["parts"] as $key=>$part): ?><span class="one-name">
                                        <a><?php echo (getChineseName($part)); ?></a>
                                        <img class="pointer delOperator" data-id="<?php echo ($part); ?>" src="/Public/Index/img/close_red.png" alt="close" width="12">
                                        <input type="hidden" name="participator[]" value="<?php echo ($part); ?>">
                                        <input type="hidden" name="user_names[]" value="<?php echo (getChineseName($part)); ?>">
                                    </span><?php endforeach; endif; ?>
                                </p>
                                <!--<a class="arrow pointer addUser addUser_2" data-id="2" data-key="participator">&#xe638;</a>-->
                                <!--<a class="pointer delData">清空</a>-->
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label"><span class="c-red">*</span>负责人</label>
                            <div class="layui-input-block layui-input checkCont value manager" style="width:90%">
                                <p class="textarea addUser addUser_3" data-id="3" data-key="manager">
                                    <span></span>
                                <?php if($info[manager] != null): if(is_array($info["manager"])): foreach($info["manager"] as $key=>$manager): ?><span class="one-name">
                                            <a><?php echo (getChineseName($manager)); ?></a>
                                            <img class="pointer delOperator" data-id="<?php echo ($manager); ?>" src="/Public/Index/img/close_red.png" alt="close" width="12">
                                            <input type="hidden" name="manager[]" value="<?php echo ($manager); ?>">
                                            <input type="hidden" name="user_names[]" value="<?php echo (getChineseName($manager)); ?>">
                                        </span><?php endforeach; endif; endif; ?>
                                </p>
                                <!--<a class="arrow pointer addUser addUser_3" data-id="3" data-key="manager">&#xe638;</a>-->
                                <!--<a class="pointer delData">清空</a>-->
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">批注领导</label>
                            <div class="layui-input-block layui-input checkCont value" style="width:90%">
                                <p class="textarea addUser addUser_4" data-id="4" data-key="opinion_leader">
                                    <span></span>
                                <?php if(is_array($info["leaders"])): foreach($info["leaders"] as $key=>$leader): ?><span class="one-name">
                                        <a><?php echo (getChineseName($leader)); ?></a>
                                        <img class="pointer delOperator" data-id="<?php echo ($leader); ?>" src="/Public/Index/img/close_red.png" alt="close" width="12">
                                        <input type="hidden" name="executor[]" value="<?php echo ($leader); ?>">
                                        <input type="hidden" name="user_names[]" value="<?php echo (getChineseName($leader)); ?>">
                                    </span><?php endforeach; endif; ?>
                                </p>
                                <!--<a class="arrow pointer addUser addUser_4" data-id="4" data-key="opinion_leader">&#xe638;</a>-->
                                <!--<a class="pointer delData">清空</a>-->
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span class="c-red">*</span>计划级别</label>
                            <div class="layui-input-block level">
                                <lable class="input_lable">
                                    <i class='input_style radio_bg <?php if($info[level] == 2): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="level" value="2" <?php echo ($info['level'] == 2 ? 'checked' : ''); ?>></i>
                                    部门级
                                </lable>
                                <lable class="input_lable">
                                    <i class='input_style radio_bg <?php if($info[level] == 1): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="level" value="1" <?php echo ($info['level'] == 1 ? 'checked' : ''); ?>></i>
                                    个人级
                                </lable>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">备注</label>
                            <div class="layui-input-block">
                                <textarea name="remark" placeholder="请输入内容" class="layui-textarea"><?php echo ($info["remark"]); ?></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"><span class="c-red">*</span>开始时间</label>
                            <div class="layui-input-block">
                                <input type="text" name="begin_date" required lay-verify="required" autocomplete="off" placeholder="点击打开日历" class="layui-input datepickerInput" value="<?php echo ($info["begin_date"]); ?>" />
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">结束时间</label>
                            <div class="layui-input-block">
                                <input type="text" name="end_date" autocomplete="off" placeholder="点击打开日历" class="layui-input datepickerInput" value="<?php echo ($info["end_date"]); ?>" />
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">计划内容</label>
                            <div class="layui-input-block">
                                <textarea name="content" placeholder="请输入内容" class="layui-textarea"><?php echo ($info["content"]); ?></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">汇报周期</label>
                            <div class="layui-input-block">
                                <select name="cycle" class="layui-input">
                                    <option value="1">一周一报</option>
                                    <option value="2">一周二报</option>
                                    <option value="3">一月一报</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">标的物</label>
                            <?php if($id != null): ?><div class="layui-input-block">
                                    <div class="fujian">
                                        <i class="iconfont">&#xe88a;</i> 
                                        <a href="#"><span class="fj">上传标的物(<?php echo (getAttchType($info["attach_type"])); ?>)</span>
                                            <span class="icon_add" id="upload">&#xe638;</span>
                                        </a>
                                        <div class="filename-cont">
                                            <?php if(is_array($uploads)): foreach($uploads as $key=>$upload): if($upload['is_pic'] == 0): ?><p style="border:0;line-height: 2em">
                                                        <a href="<?php echo ($upload["url"]); ?>" download="<?php echo ($upload["name"]); ?>"><?php echo ($upload["name"]); ?></a><img src="/Public/Index/img/close.png" style="width:15px" class="pointer delfile" data-fileurl="<?php echo ($upload["url"]); ?>">;
                                                    </p>
                                                    <?php else: ?>
                                                    <img class="showImg" src="<?php echo ($upload["url"]); ?>" width="100px" style="margin-right:10px" /><img src="/Public/Index/img/close.png" style="width:15px" class="pointer delfile" data-fileurl="<?php echo ($upload["url"]); ?>">;<?php endif; ?>
                                                <!--<span><?php echo ($upload["name"]); ?><img src="/Public/Index/img/close.png" style="width:15px" class="pointer delfile" data-fileurl="<?php echo ($upload["url"]); ?>">; </span>--><?php endforeach; endif; ?>
                                        </div>
                                    </div>
                                </div>
                                <?php else: ?>
                                <div class="layui-input-block attach_type">
                                    <lable class="input_lable">
                                        <i class='input_style radio_bg <?php if($info[attach_type] == 1): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="attach_type" value="1" <?php echo ($info['attach_type'] == 1 ? 'checked' : ''); ?>></i>
                                        word
                                    </lable>
                                    <lable class="input_lable">
                                        <i class='input_style radio_bg <?php if($info[attach_type] == 2): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="attach_type" value="2" <?php echo ($info['attach_type'] == 2 ? 'checked' : ''); ?>></i>
                                        excel
                                    </lable>
                                    <lable class="input_lable">
                                        <i class='input_style radio_bg <?php if($info[attach_type] == 3): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="attach_type" value="3" <?php echo ($info['attach_type'] == 3 ? 'checked' : ''); ?>></i>
                                        ppt
                                    </lable>
                                    <lable class="input_lable">
                                        <i class='input_style radio_bg <?php if($info[attach_type] == 4): ?>radio_bg_check<?php endif; ?>'><input type="radio" name="attach_type" value="4" <?php echo ($info['attach_type'] == 4 ? 'checked' : ''); ?>></i>
                                        code
                                    </lable>
                                    <div style="clear:both"></div>
                                </div><?php endif; ?>
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <div class="layui-input-block btnMargin">
                            <a class="layui-btn btn-submit ajax-post" data-url="<?php echo U('save');?>" data-form="">提交</a>
                            <a class="layui-btn btn-submit ajax-post planSaveBtn" data-url="<?php echo U('save',array('type'=>1));?>" data-form="">保存</a>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>


                    <input type="file" id="inputImage" name='imgfile' style="display:none">
                    <input type="hidden" id="filename" name="uploads" value="<?php echo ($uploads[0]["uploadsName"]); ?>">
                    <input type="hidden" id="fileurl" name="uploads_url" value="<?php echo ($uploads[0]["uploadsUrl"]); ?>">
                    <input type="hidden" name="url" value="<?php echo U('delFile',array('table'=>'work_plan','field'=>'plan_id','id'=>$info['plan_id']));?>">
                    <input type='hidden' name='plan_id' value='<?php echo ($info["plan_id"]); ?>'>
                </form>
            </div>
        </div>

    </section>

                    </div>
                </div>
            </div>
        </div>
        <!-- 底部区域 
        <div class="layui-footer layui-larry-foot" id="larry-footer">
            <div class="layui-mian">  
                <p class="p-admin">
                    <span>2017 &copy;</span>
                    版权所有
                </p>
            </div>
        </div>-->
    </div>
    <div class="lock-screen" style="display: none;">
        <div id="locker" class="lock-wrapper">
            <div id="time"></div>
            <div class="lock-box center">
                <!--<img src="images/userimg.jpg" alt="">-->
                <h1>admin</h1>
                <duv class="form-group col-lg-12">
                    <input type="password" placeholder='锁屏状态，请输入密码解锁' id="lock_password" class="form-control lock-input" autofocus name="lock_password">
                    <button id="unlock" class="btn btn-lock">解锁</button>
                </duv>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="/Public/Admin/js/plan.js"></script>
    <script type="text/javascript">
        //检查表单
        $('.ajax-post').on('click', function () {
            var flag = true;
            if ($('select[name=type]').val() == 1) {
                //日计划
                if ($('.cont').val() == '') {
                    layer.msg('任务内容不能为空!');
                    flag = false;
                }

                if ($('.executor .textarea span').text() == '') {
                    layer.msg('请选择执行人!');
                    flag = false;
                }

                var check = false;
                $('.flag').find('input[name=flag]').each(function () {
                    if ($(this).attr('checked') == 'checked') {
                        check = true;
                    }
                })
                if (check == false) {
                    layer.msg('请选择紧急程度!');
                    flag = false;
                }
                var check = false;
                $('.level').find('input[name=s_level]').each(function () {
                    if ($(this).attr('checked') == 'checked') {
                        check = true;
                    }
                })
                if (check == false) {
                    layer.msg('请选择计划级别!');
                    flag = false;
                }

            } else {
                //详细计划
                if ($('input[name=name]').val() == '') {
                    layer.msg('计划名称不能为空!');
                    flag = false;
                }

                if ($('.manager .textarea span').text() == '') {
                    layer.msg('请选择负责人!');
                    flag = false;
                }

                var check = false;
                $('.level').find('input[name=level]').each(function () {
                    if ($(this).attr('checked') == 'checked') {
                        check = true;
                    }
                })
                if (check == false) {
                    layer.msg('请选择计划级别!');
                    flag = false;
                }

                if ($('input[name=begin_date]').val() == '') {
                    layer.msg('开始时间不能为空!');
                    flag = false;
                }
            }

            if (flag == false) {
                $(this).removeClass('btn-submit');
            } else {
                $(this).addClass('btn-submit');
            }
        })

        $(initAddPlan());
        
        $(function () {
            if ($('select[name=type]').find('option:selected').val() == 1) {
                $('.complex').hide();
                $('.simple').show();
            } else {
                $('.complex').show();
                $('.simple').hide();
            }
        })

    </script>    
    <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
    <script>
        $(dateTime(0));
        $(initUpload("<?php echo U(CONTROLLER_NAME.'/upload');?>"));
    </script>


</body>
</html>